#pragma once

#ifdef WIN32

#include "SystemWindowInterface.h"

//在windows下的窗口实现, 由CWindowsOSThread创建
class CWindowsWindow : public ISytemWindowInterface
{
public:
    CWindowsWindow()=default;
    ~CWindowsWindow()=default;

    virtual uint64_t GetWindowID() const override;

    virtual vk::SurfaceKHR CreateVkSurfaceKHR(vk::Instance Instance) override;

    //get window content position in screen
    virtual SIntPoint GetContentPosition() const override;

    //get window content size 
    virtual SIntPoint GetContentSize() const override;

    virtual SIntPoint GetWindowSize() const override;

    virtual void SetWindowSize(SIntPoint InSize) override;

    virtual SIntPoint GetWindowPosition() const override;


    virtual void SetWindowPosition(SIntPoint InPosition) override;

    virtual void MoveToScreenCenter() override;

    virtual void SetWindowTitle(const CString& InTitle) override;

    virtual SRect GetScreenPlacableArea() override;

    virtual bool IsMaximized() const override;

    virtual void Maximize() override;

    virtual bool IsNormalSizeAndPosition() const override;

    virtual void Restore() override;

    virtual bool IsMinimized() const override;

    virtual void Minimize() override;

    virtual bool IsFullScreen() const override;

    virtual void FullScreen() override;

    virtual void ShowBorder() override;
    virtual void HideBorder() override;
    bool IsBorderVisible() const ;

    virtual void Show() override;
    virtual void Hide() override;
    virtual bool IsVisible() const override;

    virtual void SetOpcity(float InOpacity) override;

    virtual void EnableThisWindow(bool bEnable) override;
    virtual bool IsThisWindowEnabled() const override;
    
    //bring this window to front
    virtual void BringToFront() override;
    //hide this window in taskbar
    virtual void HideInTaskbar()override;

protected:
    HINSTANCE HInstance; 
    uint64_t Hwnd;

    bool bIsFullScreenMode = false;

    //系统边框是否可见
    //默认可见
    bool bIsBorderVisible = true;

    //the window that is capturing mouse
    static uint64_t CapturingMouseWindow;
    
    // drop target
    void * DropTarget = nullptr;

    friend class CWindowsOSThread;
};


#endif